<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>机构分配</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link href="<s:url value="/css/a.css"/>" type="text/css"
	rel="stylesheet" />
<link href="<c:url value="/css/index.css"/>" type="text/css"
	rel="stylesheet" />
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>

<style>
　　　
　　　　　a {
	text-decoration: none
}

　　　　　a:hover {
	color: red;
	text-decoration: none
}

a:VISITED {
	color: red;
}
　　


　　　
</style>

<script type="text/javascript">

$(document).ready(
			function() {
				$(":input[name=telList]").each(function(){
				 	var aVal=$(this).val();
				 	$(":checkbox[name=multi_sel]").each(function(){
				 		var orgval=$(this).val();
				 		if(aVal==orgval){
				 			$(this).attr('checked',true);
				 			
				 		}
				 	});
				 	
				 });
				var allLen= $(":checkbox[name=multi_sel]").length;
				var checkedLen=$(":checkbox[name=multi_sel]:checked").length;
				//alert(allLen+"|"+checkedLen);
				if(allLen==checkedLen){
				//	$("#gxBtn").attr('disabled',true);
				}
	
				$("#gxBtn").click(function(){
				    var len=$(":checkbox[name=multi_sel]:checked").length;
					if(len>0){
						  $("#queryTellsForm").attr("action","orgDistributeAdd.action");
						  $("#queryTellsForm").submit();
						  return true;
					}else{
						alert('请选择要分配的机构信息！！！');
						return false;
					}
			
			});
				
			});

  </script>

	

  </head>
  
  <body>
   
       <div class="subpage">
	     
		<s:form id="queryTellsForm"  action="orgDistributeInfo.action" method="post"
			theme="simple">
    	<div class="user_title">
				<h2 class="headline-inquires">
					POS收单运营管理平台<br />
					<span class="sub-title"></span>
				</h2>
			</div>
			<table width="100%" cellpadding="0" cellspacing="0" border="0"
				class="query_table">
				<tr>
					<td align="right" width="20%">操作员：</td>	
					<td align="left" width="30%">
					<s:select id="accountNo" name="merchant.accountNo" cssClass="queryWidth" list="#request.operators" listKey="accountNo" listValue="realName"/></td>
				</tr>
				<tr>
						<td colspan="2" align="center"><span style="font-color: red"><s:actionerror /></span>
							<span style="font-color: red;"><s:actionmessage /></span > <span style="font-color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
					</tr>
				<tr>
					<td colspan="4" align="center"><s:submit value="查   询" />&nbsp;&nbsp;&nbsp;&nbsp;
					<s:if test="#request.organList!=null&&#request.organList.size>0">
					  <s:submit id="gxBtn" value="分  配" />
					</s:if>
				<s:else>
				 <s:submit disabled="true" id="gxBtn" value="分  配" />
				</s:else>
					
					</td>
				</tr>
			</table>
			
			
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="query_table">
					    <tr>
                          <th colspan="4">
                          <h2 class="headline-inquires">操作员基本信息</h2>
                          </th>
                        </tr>
                       </table>
			<table id="tableList" width="100%" class="table">
						<thead>
							<tr>
		                	   
								<th>账号</th>
								<th>姓名</th>
								<th>所属机构</th>
								<th>地址</th>
							</tr>
						</thead>
						<tbody>
									<s:hidden name="merchant.id"/>
									<tr>
									<td align="center"> <s:property value="#request.merchant.accountNo"/> </td>
									<td align="center"> <s:property value="#request.merchant.realName"/> </td>
									<td align="center">
	                          		<s:iterator value="#request.organList" id="org">
	                              		<s:if test="#org.org_code == #request.merchant.orgCode">
	                              			<s:property value="#org.org_name"/>
	                              		</s:if>
	                            	</s:iterator>
	                          		</td>
									<td align="center"> <s:property value="#request.merchant.address"/> </td>
								    </tr>
							
						</tbody>
					</table>
			   
                 	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="query_table">
					    <tr>
                          <th colspan="4">
                           <h2 class="headline-inquires">机构基本信息</h2>
                          </th>
                        </tr>
                       </table>
            			
					<table id="tableLists" width="100%" class="table">
						<thead>
							<tr>
		                	    <th>选择</th> 
								<th>机构代码</th>
								<th>机构名称</th>
								<th>证件号</th>
							</tr>
						</thead>
						<tbody>
						<s:iterator value="#request.telList" id="tl">
								 <s:hidden  name="telList" value="%{#tl.orgId}"/>				
						</s:iterator>
							<s:iterator value="#request.organList" status="stat" id="og">
								  <tr class="<s:if test="#stat.index%2==0">tr_0</s:if>" >
									
								 		
										  <td align="center">
									       		<s:checkboxlist  name="multi_sel" list="#{#og.id:''}"  theme="simple" />
								          </td>
											
								 		
								    		<td align="center"> <s:property value="#og.org_code"/> </td>
											<td align="center"> <s:property value="#og.org_name"/> </td>
											<td align="center"> <s:property value="#og.cardNo"/> </td>
											
								   </tr> 
							</s:iterator>
						</tbody>
					</table>
			  
	</s:form>
	</div>
	
  </body>
</html>
